package com.chenfan.mcn.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chenfan.common.vo.UserVO;
import com.chenfan.mcn.model.BusinessCommissionDetailTemporary;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.BusinessCommissionUpdateDTO;
import com.chenfan.mcn.model.dto.ExcutionOrderSearchDTO;
import com.chenfan.mcn.model.dto.IncomeContractSearchDTO;
import com.chenfan.mcn.model.vo.*;

import java.util.List;

/**
 * <p>
 * 商务提成明细临时表 服务类
 * </p>
 *
 * @author lizhejin
 * @since 2021-06-07
 */
public interface BusinessCommissionDetailTemporaryService extends IService<BusinessCommissionDetailTemporary> {

    /**
     * 添加合同（全选并确认）
     *
     * @param addContract {@link AddContract}
     * @return {@link String}
     */
    String addContract(AddContract addContract);

    /**
     * 批量删除
     *
     * @param ids {@link List<Long>}
     * @return {@link Boolean}
     */
    Boolean batchDelete(List<Long> ids);

    /**
     * 编辑列表
     *
     * @param dto    传参
     * @return {@link Integer}
     */
    Integer edit(BusinessCommissionUpdateDTO dto);

    /**
     * 新建页提成明细列表
     *
     * @param page                分页
     * @param detailListSearchDTO 筛选条件
     * @return {@link BusinessCommissionDetailList}
     */
    BusinessCommissionDetailList detailList(McnPage<BusinessCommissionDetailTemporary> page, DetailListSearchDTO detailListSearchDTO);

    /**
     * 添加合同（全选并确认）
     *
     * @param allContract {@link IncomeContractSearchDTO}
     * @return {@link String}
     */
    String selectAllAndConfirm(ExcutionOrderSearchDTO allContract);

    /**
     * 切换季度
     *
     * @param quarterCode   季度编号
     * @param temporaryCode 临时表编号
     */
    void switchQuarter(String quarterCode, String temporaryCode);

    /**
     * 获取商务提成筛选项值
     *
     * @param temporaryCode {@link String}
     * @return {@link BusinessBoxList}
     */
    BusinessBoxList getCommissionList(String temporaryCode);

    /**
     * 执行商务提成规则
     * @param temporaryCode
     * @param incomeContracts
     * @return
     */
    List<BusinessCommissionDetailTemporary> executeBusinessCommissionRule(String temporaryCode, List<QuarterIncomeContractVO> incomeContracts);
}
